from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By

service = Service(executable_path="chromedriver.exe")
driver = webdriver.Chrome(service=service)

driver.get("https://deyunce:828123@mall.deyunce.com/pc/")
#全屏显示
driver.maximize_window()
sleep(2)

driver.find_element(By.XPATH,"//a[contains(text(),'登录')]").click()
#登录
driver.find_element(By.XPATH,'//div[contains(text(),"账号密码登录")]').click()
sleep(2)
#登录密码
driver.find_element(By.XPATH,"//input[@placeholder='请输入账号/手机号码']").send_keys("18895747832")
driver.find_element(By.XPATH,"//input[@placeholder='请输入密码']").send_keys("dxy123..456")
sleep(2)

#点击登录
driver.find_elements(By.XPATH,"//span[contains(text(),'立即登录')]")[1].click()
sleep(2)

#点击搜索框
driver.find_element(By.XPATH,'//input[@placeholder="请输入要搜索的商品名称"]').send_keys("熊猫")
sleep(2)
#点击搜索
driver.find_element(By.XPATH,"//div[contains(text(),'搜索')]").click()
sleep(5)

driver.quit()